package com.badibadi.mail;

import com.badibadi.activity.ConsultingEvaluationActivity;
import com.badibadi.uniclubber.R;
import com.badibadi.uniclubber.R.layout;
import com.badibadi.uniclubber.R.menu;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MailotherQingkuangActivity extends Mail245Activity {

	AlertDialog al_sheding;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
//		setContentView(R.layout.activity_mailother_qingkuang);
	}

	@Override
	protected void DongTaiPeiZhi() {
		// TODO Auto-generated method stub
		TextView title_mail=(TextView)this.findViewById(R.id.title_mail);
		title_mail.setText(getResources().getString(R.string.wx_reply_zhanneixin));
		
		
		if (rank.equals("answerer")) {
			TextView tishi = (TextView) this.findViewById(R.id.tishi);
			tishi.setText(getResources().getString(R.string.wx_jiaoyi_end_kuohao));
			tishi.setVisibility(View.VISIBLE);
			Button shedingzhixunfei = (Button) this
					.findViewById(R.id.shedingzhixunfei);
			shedingzhixunfei.setText(getResources().getString(R.string.wx_jiaoyi_end));
			shedingzhixunfei.setVisibility(View.VISIBLE);
			shedingzhixunfei.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					LayoutInflater inflater=LayoutInflater.from(MailotherQingkuangActivity.this);
		            View view=inflater.inflate(R.layout.jiaoyijieshu, null);

		            
		            
		            //评价
		            Button queding=(Button)view.findViewById(R.id.queding);
		            queding.setOnClickListener(new View.OnClickListener() {
						
						@Override
						public void onClick(View v) {
							// TODO Auto-generated method stub
					          Intent intent=new Intent(MailotherQingkuangActivity.this,ConsultingEvaluationActivity.class);
					          intent.putExtra("uid", payUserContactShow1Model.getSent_uid());
					          intent.putExtra("chuanru_zhanneiId", payUserContactShow1Model.getZhannei_Id());
					          intent.putExtra("chuanru_asker_or_answerer", "answerer");
					          startActivity(intent);
						
						}
					});
		            
					al_sheding=new AlertDialog.Builder(MailotherQingkuangActivity.this).setView(view).show();
				}
			});

		} else {//问方
			TextView tishi = (TextView) this.findViewById(R.id.tishi);
			tishi.setText(getResources().getString(R.string.wx_jiaoyi_end_kuohao));
			tishi.setVisibility(View.VISIBLE);
			Button shedingzhixunfei = (Button) this
					.findViewById(R.id.shedingzhixunfei);
			shedingzhixunfei.setText(getResources().getString(R.string.wx_jiaoyi_end));
			shedingzhixunfei.setVisibility(View.VISIBLE);
			shedingzhixunfei.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					LayoutInflater inflater=LayoutInflater.from(MailotherQingkuangActivity.this);
		            View view=inflater.inflate(R.layout.jiaoyijieshu, null);
		            Button queding=(Button)view.findViewById(R.id.queding);
		            queding.setOnClickListener(new View.OnClickListener() {
						
						@Override
						public void onClick(View v) {
							// TODO Auto-generated method stub
					          
							  Intent intent=new Intent(MailotherQingkuangActivity.this,ConsultingEvaluationActivity.class);
					          intent.putExtra("uid", payUserContactShow1Model.getUid());
					          intent.putExtra("chuanru_zhanneiId", payUserContactShow1Model.getZhannei_Id());
					          intent.putExtra("chuanru_asker_or_answerer", "asker");
					          startActivity(intent);
						}
					});
		            
					al_sheding=new AlertDialog.Builder(MailotherQingkuangActivity.this).setView(view).show();
					
					
				}
			});
		}
	}

}
